package com.mt.api.core.sms;

import com.mt.api.core.threadpool.ThreadPoolUtils;

import java.util.concurrent.ExecutorService;

/**
 * @Author: plover
 * @Date: 2020/07/09/3:49 下午
 * @Description:
 */
public class SmsFactory {

    private static SmsFactory smsFactory = new SmsFactory();

    private ExecutorService executorService = ThreadPoolUtils.getThreadPool("sms-send");

    private SmsFactory(){

    }

    public static SmsFactory getInstance(){
        return smsFactory;
    }

    public void sendSms(SmsSend smsSend){
        executorService.execute(() -> {
            SmsUtils.send(smsSend);
        });
    }
}
